package core;

public class EdgeData {
	private double flow;
	private double capacity;
	
	public EdgeData(double flow, double capacity) {
		super();
		this.flow = flow;
		this.capacity = capacity;
	}

	public EdgeData(double capacity) {
		super();
		this.flow = 0;
		this.capacity = capacity;
	}
	
	public EdgeData() {
		super();
		this.flow = 0;
		this.capacity = 0;
	}

	public double getFlow() {
		return flow;
	}

	public void setFlow(double flow) {
		this.flow = flow;
	}

	public double getCapacity() {
		return capacity;
	}

	public void setCapacity(double capacity) {
		this.capacity = capacity;
	}
	
	public double getAvailable(){
		return capacity - flow;
	}
	
	public boolean isForwardEdge(){
		return this.capacity - this.flow > 0;
	}
	
	public boolean isBackwardEdge(){
		return !isForwardEdge();
	}
	
	public void increasFlowBy(double bottleneck){
		setFlow(this.flow + bottleneck);
	}
	
	public void decreaseFlowBy(double bottleneck){
		setFlow(this.flow - bottleneck);
	}
}
